d86487047e45db9e27e2fe7a7753045613c45eca,staging/maven-plugin/src/main/java/org/sonatype/nexus/maven/staging/deploy/DeployStagedMojo.java,DeployStagedMojo,execute,#,40

Before Change


  {
    failIfOffline();

    final LastProjectWithThisMojoInExecution lastProjectWithThisMojoInExecution = isThisLastProjectWithThisMojoInExecution();
    if (LastProjectWithThisMojoInExecution.YES == lastProjectWithThisMojoInExecution) {
      try {
        final DeployStrategy deployStrategy;
        if (getMavenSession().getCurrentProject().getArtifact().isSnapshot()) {
          deployStrategy = getDeployStrategy(Strategies.DEFERRED);
        }
        else {
          deployStrategy = getDeployStrategy(Strategies.STAGING);
        }

        final Parameters parameters = buildParameters(deployStrategy);
        final FinalizeDeployRequest request = new FinalizeDeployRequest(getMavenSession(), parameters);

        deployStrategy.finalizeDeploy(request);
      }
      catch (ArtifactDeploymentException e) {
        throw new MojoExecutionException(e.getMessage(), e);
      }
    }
    else if (LastProjectWithThisMojoInExecution.NO == lastProjectWithThisMojoInExecution) {
      getLog().info("Execution skipped to the last project...");
    }
  }
}

After Change


  {
    failIfOffline();

    if (isThisLastProjectWithThisMojoInExecution()) {
      try {
        final DeployStrategy deployStrategy;
        if (getMavenSession().getCurrentProject().getArtifact().isSnapshot()) {